home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / tomtools < prev    next >
Internet Message Format  |  1995-03-31  |  3KB

  1. From conte@crest.csg.uiuc.edu Mon Apr  9 18:11:54 1990
  2. From: conte@crest.csg.uiuc.edu (Tom Conte)
  3. Newsgroups: comp.sys.handhelds
  4. Subject: Two tools for 48sx
  5. Keywords: 48sx, hp
  6. Date: 8 Apr 90 21:40:19 GMT
  7. Reply-To: conte@crest.csg.uiuc.edu (Tom Conte)
  8. Organization: University of Illinois at Urbana
  9.  
  10. Here are two tools I've found useful for the 48sx.  Included is also
  11. one open question...
  12.  
  13. The first uses vectored enters to perform a nice `printerless printer'
  14. interface: every operation is displayed in the status area.  For example,
  15. 6 ENTER 5 + 7 /  would first display 6 in the status area, then "5 +",
  16. then "7 /".  I've found this real, real handy in a test/pressure situation
  17. where I wanted to make sure I had just hit the right key.  With a litte
  18. alteration, this can be turned into a trace mode for the printer.  
  19.  
  20. [sorry, no serial cable yet, I've done my best to make it easy on
  21. those who have a cable]
  22.  
  23. xsum: #1E19h, bytes: 27
  24. '\GaENTER'        @ \Ga means `alpha', right-shifted A
  25. \<< DUP 'L' STO OBJ\-> \>>
  26.  
  27. xsum: #1D8Dh, bytes: 71
  28. '\GbENTER'        @ \Gb means `beta', right-shifted B
  29. \<< 'L' RCL " " ROT "\010" @ a new-line
  30. + + + 1 DISP 1 FREEZE "" 'L' STO \>>
  31.  
  32. xsum: #A657h, bytes: 53
  33. 'PPON'
  34. \<< -62 -63 SF SF "" 'L' STO \>>
  35.  
  36. xsum: #44ADh, bytes: 48
  37. 'PPOFF'
  38. \<< -62 -63 CF CF 'L' PURGE \>>
  39.  
  40.  
  41. The second tool is useful for finding out the USER-mode bindings of
  42. a key.  You execute SKEY and then hit a key, and it shows you all
  43. the assignments for that key.
  44.  
  45. xsum: #DB67h, bytes: 371.5
  46. 'SKEY'
  47. \<< 10 CF
  48. "Press key to see\010its assignments:"
  49. 1 DISP 1 FREEZE
  50.   WHILE KEY 0 ==
  51.   REPEAT
  52.   END LASTARG DROP
  53. { "  :" " L:" " R:"
  54. " \Ga:" "L\Ga:" "R\Ga:" }    @ \Ga means `alpha', right-shifted A
  55. RCLKEYS \-> k l a @ just a plain old lower-case "K L A" here
  56.   \<< "" 1 6
  57.       FOR i l i GET a    @ lower-case a
  58. k i 10 / + POS
  59.         IF DUP 0 \=/    @ \=/ is the not-equals sign, right-shifted Y
  60.         THEN 1 - a    @ lower-case a
  61. SWAP GET \->STR 10 SF
  62.         ELSE DROP ""
  63.         END "\010"    @ a new-line
  64. + + +
  65.         NEXT
  66.         IF 10 FC?
  67.         THEN DROP
  68. "No assignments\010"    @ a new-line
  69.         END 1 DISP 3
  70. FREEZE
  71.   \>>
  72. \>>
  73.  
  74.  
  75. And now the question: the above, when confronted with a string that contains
  76. a new-line, will DISPlay it in multi-line form.  But this is cumbersome, since
  77. I would like to restrict output to a single line, perhaps terminating with
  78. a "...".  In other words, I would like to display a string the way the oper-
  79. ating system does when the string is in levels 2 or greater.  Any clues how
  80. to do this?
  81.  
  82. ------
  83. Tom Conte      Center for Reliable and High-Performance Computing
  84.  conte@uiuc.edu   University of Illinois, Urbana-Champaign, Illinois
  85.  
  86.